#!/usr/bin/env bash
# Copyright (c) 2024 maminjie <canpool@163.com>
# SPDX-License-Identifier: MulanPSL-2.0


__script_do() {
    local interpreter="$1"
    local script_file="$2"
    shift 2
    if [ -f "$script_file" ]; then
        if [ "$interpreter" = "bash" ]; then
            $interpreter $shopt_option "$script_file" "$@"
        else
            $interpreter "$script_file" "$@"
        fi
    else
        echo "$script_file: no such file"
    fi
}

script_do_bash() {
    __script_do "bash" "$@"
}

script_do_python() {
    __script_do "python3" "$@"
}
